package org.springframework.event;

import org.springframework.context.ApplicationEvent;

/**
 * 自定义事件
 */
public class MyselfEvent extends ApplicationEvent {
	private static final long serialVersionUID = 1L;

	private String message;

    public MyselfEvent(Object source, String message) {
        super(source);
        this.message = message;
    }

    public String getMessage() {
        return message;
    }

    public void event() {
        // 处理事件逻辑
		System.out.println("开始处理事件逻辑");
        System.out.println("Event method called with message: " + message);
    }
}